//
//  ViewController.m
//  通知学习
//
//  Created by slience on 2019/10/14.
//  Copyright © 2019 shehuiren. All rights reserved.
//

#import "ViewController.h"

#import "WWNotificationCenter.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 通知是一个全局的单例，有个字典属性，字典的key 是通知的名字  value 是一个数据模型（包括方法，观察者，通知名字，携带的参数等等）
      
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(tt) name:@"rrr" object:nil];
    
    
    [[WWNotificationCenter defaultCenter]addObserver:self selector:@selector(ttt) name:@"aaa" object:nil];
    
//    [[WWNotificationCenter defaultCenter]addObserver:self selector:@selector(ttt) name:@"aaa" object:nil];

}

-(void)ttt{
    
    NSLog(@"%@",[NSThread currentThread]);
    NSLog(@"点我了哥们");
}

-(void)tt{
    
    NSLog(@"点我了哥们");
}


-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [[WWNotificationCenter defaultCenter]postNotificationName:@"aaa" object:nil];
}


@end
